﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<TanHungViet.Web.Models.MenuItem>>" %>

<div id="menu-head">
	<ul id="nav-one" class="dropmenu"> 
	    <%foreach (var item in Model) { %>
            <%if (item.SubMenu == null || item.SubMenu.Count == 0)
              { %>
                <li> 
			        <a href="<%=item.Link%>"><%=item.Title%></a> 
		        </li> 
            <%}
              else
              { %>
                <li class="haschildren"> 
			        <a href="#"><%=item.Title%><span class="arrow"></span></a>
			        <ul class="submenu"> 
			            <% foreach (var sub in item.SubMenu)
                        { %>
                            <li> 
                                <a href="<%=sub.Link%>"><%=sub.Title%></a> 
                            </li>
			            <%} %>
			        </ul>  
		        </li> 
            <%} %>
       
	    <%} %>
	</ul>
</div>